package com.xiaohai.big_event_system.annotation;

import com.xiaohai.big_event_system.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;


/**
 * 自定义注解用户规则校验
 */
@Documented // 生成文档
@Constraint(validatedBy = {StateValidation.class}) // 指定验证器位置
@Target({ElementType.FIELD}) // 作用位置
@Retention(RetentionPolicy.RUNTIME) // 调用时机
public @interface State {
    String message() default "参数值只能为已发布或草稿";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
